package com.wuyan.locationdog.adapter

import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.LayoutRes
import com.arcsoft.commonbase.bean.DataBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.wuyan.locationdog.R


class MarkSetListAdapter(@LayoutRes layoutResId: Int, data: MutableList<DataBean>?) :
    BaseQuickAdapter<DataBean, BaseViewHolder>(layoutResId, data) {


    override fun convert(holder: BaseViewHolder, item: DataBean) {
        holder.apply {
            getView<TextView>(R.id.name).setText(item.name)
            getView<ImageView>(R.id.img).setImageResource(item.img)
            val imageView = getView<ImageView>(R.id.ivCheck)
            if (item.isSelect) {
                imageView.setImageResource(R.mipmap.radio_select)
            } else {
                imageView.setImageResource(R.mipmap.radio_unselect)
            }
        }
    }
}




